package com.leyou.item.mapper;

import com.leyou.common.mapper.BaseMapper;
import com.leyou.item.entity.Category;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;


public interface CategoryMapper extends BaseMapper<Category> {
    //查询品牌对应的种类列表
    @Select("SELECT tc.id,tc.name,tc.parent_id,tc.is_parent,tc.sort FROM tb_category_brand tcb INNER JOIN tb_category tc ON tcb.category_id=tc.id AND tcb.brand_id=#{brandId}")
    List<Category> queryByBrandId(@Param("brandId") Long brandId);

}
